package com.android.pos;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class mainActivity extends Activity {
	
	private Button BtnGetOrder;
	private Button BtnCurTables;
	private Button BtnSettings;
	
	private static final int TOAST_LENGTH = 1;
	
    private static final String Flag = "allbory-pos";

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        Log.d(Flag,">>> first loading or refresh allbory-pos...");
        setContentView(R.layout.main);

        Log.d(Flag,">>> Loading BtnGetOrder button allbory-pos...");        
        // when click new order button
        BtnGetOrder = (Button)findViewById(R.id.btn_getorder);
        BtnGetOrder.setOnClickListener(new Button.OnClickListener() {

			public void onClick(View arg0) {
	        	Context context = getApplicationContext();        	
//	        	Toast.makeText(context, "Not implemented yet", TOAST_LENGTH).show();
				Log.d(Flag,"It's about to open NewOrder Activity");
	    		Intent intent = new Intent(mainActivity.this, NewOrder.class);
	    		startActivity(intent);	        	
				
			}

        });
        
        Log.d(Flag,">>> Loading BtnCurTables button allbory-pos...");        
        BtnCurTables = (Button)findViewById(R.id.btn_curtables);
        BtnCurTables.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View arg0) {
	        	Context context = getApplicationContext();        	
	        	Toast.makeText(context, "Not implemented yet", TOAST_LENGTH).show();
				
			}        	
        });
        
        Log.d(Flag,">>> Loading BtnSettings button allbory-pos...");        
        BtnSettings = (Button)findViewById(R.id.btn_settings);
        BtnSettings.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				Log.d(Flag,"It's about to open POSSettings Activity");
	    		Intent intent = new Intent(mainActivity.this, POSSettings.class);
	    		startActivity(intent);
			}
        });
    }
}